Set the max listener limit to 1000 for RheaConnection
#110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
NodeJS would issue warning if the number of disconnected listeners on an event emitter exceeds 10. When many sessions or links on a connection are closed at the same time, we will see this warning because the default limit of 10 in NodeJS is too low. The disconnected listeners DO get removed eventually.
This causes Azure/azure-sdk-for-js#29186 when it stops all its
Linkobjects at the same time.(Source links:
Link.stopcall, the loop)azure-sdk-for-jsalready raises the limit this for some other objects. SinceConnection._connectionis private and thedisconnectlisteners are an implementation detail ofrhea-promise, I felt it was more appropriate to address it here.There's also a draft PR #78 from 2021 trying to address this issue, but it looks a lot like (partially) reimplementing
EventEmitterjust to remove the listener warning. That's why I ultimately decided to go withsetMaxListeners.Brief description of the changes made in the PR. This helps in making better changelog
MaxListenersExceededWarningwhen closing multiple links or sessions.Reference to any github issues